﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ValidatorControl.aspx.cs" Inherits="DotNet.WebUI.BasicControl.ValidatorControl" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        td
        {
            font-size:12px;
        }    
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width:100%;">
        <table style="width:600px; margin:auto;">
            <tr>
                <td align="right">
                    登录代码</td>
                <td align="left">
                    <asp:TextBox ID="txtLoginID" runat="server" Width="400px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtLoginID" ErrorMessage="请输入登录代码">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    密码</td>
                <td align="left">
                    <asp:TextBox ID="txtPwd" runat="server" Width="400px" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtPwd" ErrorMessage="请输入密码">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">确认密码</td>
                <td align="left">
                    <asp:TextBox ID="txtConfirmPwd" runat="server" Width="400px" 
                        TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="txtConfirmPwd" ErrorMessage="请输入确认密码">*</asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                        ControlToCompare="txtPwd" ControlToValidate="txtConfirmPwd" 
                        ErrorMessage="密码和确认密码不相等">*</asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    性别</td>
                <td align="left">
                    &nbsp;
                    <asp:RadioButtonList ID="radSex" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="1">男</asp:ListItem>
                        <asp:ListItem Value="2">女</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    出生年月</td>
                <td align="left">
                    <asp:TextBox ID="txtBirthday" runat="server" Width="400px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txtBirthday" ErrorMessage="请输入出生年月">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                        ErrorMessage="出生日期必须在1980-1-1至2001-12-31" MaximumValue="2001-12-31" 
                        MinimumValue="1980-1-1" ControlToValidate="txtBirthday">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    最高学历</td>
                <td align="left">
                    <asp:DropDownList ID="dplKnowledge" runat="server" Width="400px">
                        <asp:ListItem Value="1">初中</asp:ListItem>
                        <asp:ListItem Value="2">高中</asp:ListItem>
                        <asp:ListItem Value="3">中专</asp:ListItem>
                        <asp:ListItem Value="4">大专</asp:ListItem>
                        <asp:ListItem Value="5">本科</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    邮编</td>
                <td align="left">
                    <asp:TextBox ID="txtPost" runat="server" Width="400px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ControlToValidate="txtPost" ErrorMessage="请输入邮编">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtPost" ErrorMessage="必须输入6位邮编" 
                        ValidationExpression="\d{6}">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    邮箱</td>
                <td align="left">
                    <asp:TextBox ID="txtEmail" runat="server" Width="400px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                        ControlToValidate="txtEmail" ErrorMessage="请输入邮箱">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="txtEmail" ErrorMessage="请输入正确邮编" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    爱好</td>
                <td align="left">
                    <asp:CheckBoxList ID="chkInterest" runat="server" RepeatColumns="3" 
                        RepeatDirection="Horizontal" Width="400px">
                        <asp:ListItem Value="1">图书/杂志</asp:ListItem>
                        <asp:ListItem Value="2">音乐/影视 </asp:ListItem>
                        <asp:ListItem Value="3"> 体育/户外运动 </asp:ListItem>
                        <asp:ListItem Value="4">旅游/出差</asp:ListItem>
                        <asp:ListItem Value="5">休闲/娱乐 </asp:ListItem>
                        <asp:ListItem Value="6"> 美食/酒吧 </asp:ListItem>
                        <asp:ListItem Value="7">汽车/交通工具</asp:ListItem>
                    </asp:CheckBoxList>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:LinkButton ID="btnReg" runat="server" onclick="btnReg_Click">注册</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="left">
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>